package com.example.testThread;

/**
 * @Author 郅占伟
 * @ClassName InputThread
 * @Description TODO
 * @Date 2024年06月29日
 * @Version: 1.0
 */
public class InputThread extends Thread {

    public static Integer count = 0;

    private Thread photoThread;

    public InputThread(Thread photoThread) {
        this.photoThread = photoThread;
    }

    @Override
    public void run() {
        try {
            photoThread.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        for (int i = 0; i < 100; i++) {
            count++;
            if (count == 50){
                try {
                    System.out.println("入库线程开始休眠-----------");
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
            System.out.println("入库线程开始运行");
        }
        System.out.println("入库线程结束运行");
    }
}
